package net.maxwoods.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.AbstractContextLoaderInitializer;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

class MyWebInif //extends AbstractContextLoaderInitializer
{

    private static final Logger logger=LoggerFactory.getLogger(MyWebInif.class);

    //@Override
    protected WebApplicationContext createRootApplicationContext()
    {
        AnnotationConfigWebApplicationContext servletAppContext = new AnnotationConfigWebApplicationContext();

        Class<?>[] configClasses = {RootConfig.class};
        if (!ObjectUtils.isEmpty(configClasses)) {
            servletAppContext.register(configClasses);
        }
        logger.info("spring 初始化:{}",getClass().getName());
        return servletAppContext;
    }
}
